home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / System / DragX 1.0a1 / Source / DragX.h < prev    next >
Text File  |  1996-05-02  |  2KB  |  88 lines

  1. /*
  2.  *        DragX.h
  3.  *
  4.  *        Copyright © 1995-96 Marco Piovanelli <mailto:piovanel@kagi.com>
  5.  *        All Rights Reversed
  6.  */
  7.  
  8.  
  9. #pragma once
  10.  
  11. #ifndef __DEVICES__
  12. #include <Devices.h>
  13. #endif
  14.  
  15. #ifndef __FILES__
  16. #include <Files.h>
  17. #endif
  18.  
  19. #ifndef __RESOURCES__
  20. #include <Resources.h>
  21. #endif
  22.  
  23. #ifndef __ERRORS__
  24. #include <Errors.h>
  25. #endif
  26.  
  27. #ifndef __TEXTEDIT__
  28. #include <TextEdit.h>
  29. #endif
  30.  
  31. #ifndef __COMPONENTS__
  32. #include <Components.h>
  33. #endif
  34.  
  35. #ifndef __TRANSLATIONEXTENSIONS__
  36. #include <TranslationExtensions.h>
  37. #endif
  38.  
  39. #ifndef __DRAG__
  40. #include <Drag.h>
  41. #endif
  42.  
  43. const FourCharCode    kDragXSignature = 'DrgX' ;
  44. const UInt32 kDragXVersion = 0 ;
  45. const UInt32 kMinHFSFlavorSize = 17 ;
  46.  
  47. enum
  48. {
  49.     flavorTypeText                    =    'TEXT' ,
  50.     flavorTypeTextStyles        =    'styl' ,
  51.     flavorTypeStyledText        =    'stxt'
  52. } ;
  53.  
  54. struct GlobalsRecord
  55. {
  56.     OSType signature ;                        // record signature; must be kDragXSignature
  57.     ComponentInstance instance ;        // component instance
  58. } ;
  59. typedef struct GlobalsRecord * GlobalsPtr ;
  60. typedef struct GlobalsRecord * const GlobalsPtrConst ;
  61.  
  62. struct DragXScrapTranslationList
  63. {
  64.     ScrapTranslationList header ;                // modification time & group count
  65.     long srcCount ;                                        // number of source types (= 1)
  66.     Size srcEntrySize ;                                    // must be sizeof ( ScrapTypeSpec )
  67.     ScrapTypeSpec srcSpec [ 1 ] ;                // source type spec
  68.     long dstCount ;                                        // number of destination types (= 1)
  69.     Size dstEntrySize ;                                // must be sizeof ( ScrapTypeSpec )
  70.     ScrapTypeSpec dstSpec [ 1 ] ;                // destination type spec
  71. } ;
  72.  
  73. // component entry point
  74. pascal ComponentResult main ( ComponentParameters * params, Handle globals ) ;
  75.  
  76. // common Component Manager selectors
  77. pascal ComponentResult DragX_CanDo ( GlobalsPtr g, SInt16 selector ) ;
  78. pascal ComponentResult DragX_Open ( GlobalsPtr g, ComponentInstance self ) ;
  79. pascal ComponentResult DragX_Close ( GlobalsPtr g, ComponentInstance self ) ;
  80.  
  81. // selectors for scrap translation extensions
  82. pascal ComponentResult DragX_GetScrapTranslationList ( GlobalsPtr g, Handle list ) ;
  83. pascal ComponentResult DragX_IdentifyScrap ( GlobalsPtr g, const void * dataPtr, Size dataLength, ScrapType * dataFormat ) ;
  84. pascal ComponentResult DragX_TranslateScrap ( GlobalsPtr g, TranslationRefNum refNum, const void * srcDataPtr, Size srcDataSize, ScrapType srcType, long srcTypeHint, Handle dstData, ScrapType dstType, long dstTypeHint ) ;
  85.  
  86. // utility routines
  87. void BlockClear ( void * blockPtr, Size blockSize ) ;
  88.